5 REM **** BASIC KEYWORDS **** 10 REM ** BY STEVE WERKMAN ** 15 REM ** 424 E. SECOND ST. ** 20 REM ** PERRYSBURG,OH 43551 ** 25 REM ************************** 26 REM ** REFERENCES ** 27 REM ** COMMODORE 64 PROGRAMMER'S REFERENCE GUIDE 28 REM ** COMMODORE BUSINESS MACHINES INC & HOWARD W. SAMS & CO. INC. 29 REM ** YOUR COMMODORE 64 - JOHN HEILBORN & RON TALBOTT 30 REM ** OSBORNE/MCGRAW -HILL 35 PRINT"[147]" 40 PRINTTAB(14)"[158][169] [223][146] [169] [146]" 42 PRINTTAB(14)" [146] [169][146][169]  [146]" 44 PRINTTAB(14)" [146][183][183] [146][169] [146]" 46 PRINTTAB(14)"[223] [146][169]  [146] " 47 PRINTTAB(17)"BASIC":PRINTTAB(13)"BASIC KEYWORDS" 48 PRINTTAB(12)"BY STEVE WERKMAN" 50 FOR I=1 TO 4000:NEXT I 80 POKE53281,1:POKE53280,14 90 K$="PRESS ANY KEY TO CONTINUE" 91 S$="SELECT NUMBER FOR EXPLANATION" 92 F$="PRESS F1 FOR NEXT MENU" 93 B$="PRESS F7 FOR PREVIOUS MENU" 95 PRINT "[147][154]" 100 PRINTTAB(5)"[144]BASIC COMMANDS. (COMMAND MODE)" 110 PRINTTAB(15)"1.- CONT[157][157][157][157][157][157][157][157]2.- LIST" 120 PRINTTAB(15)"3.- LOAD[157][157][157][157][157][157][157][157]4.- NEW[157][157][157][157][157][157][157]5.- RUN" 130 PRINTTAB(15)"6.- SAVE[157][157][157][157][157][157][157][157]7.- VERIFY" 140 PRINT""S$ 145 PRINT""F$ 146 GET A$:IF A$=""THEN146 150 IF A$="[133]"THEN200 151 A=VAL(A$) 152 ON A GOTO 1010,1020,1030,1040,1050,1060,1070 158 IF A<1 OR A>7 THEN 146 200 PRINTCHR$(147) 210 PRINTTAB(9)"PROGRAM CONTROLLERS" 220 PRINTTAB(12)"1.- END[157][157][157][157][157][157][157]2.- FOR..NEXT[157][157][157][157][157][157][157][157][157][157][157][157][157]3.- GOSUB..RETURN" 230 PRINTTAB(12)"4.- IF..THEN[157][157][157][157][157][157][157][157][157][157][157][157]5.- GOTO[157][157][157][157][157][157][157][157]6.- ON..GOTO" 240 PRINTTAB(12)"7.- ON GO..SUB[157][157][157][157][157][157][157][157][157][157][157][157][157][157]8.- STOP" 241 PRINTS$ 242 PRINTB$ 245 PRINTF$ 246 GET A$:IF A$=""THEN246 249 IF A$="[133]"THEN300 250 IF A$="[136]"THEN95 251 A=VAL(A$) 252 ON A GOTO 2010,2020,2030,2040,2051,2060,2070,2080 260 IF A<1ORA>8THEN246 300 PRINTCHR$(147) 310 PRINTTAB(5)"KEYBOARD & SCREEN CONTROLLERS" 320 PRINTTAB(12)"1.- GET[157][157][157][157][157][157][157]2.- INPUT[157][157][157][157][157][157][157][157][157]3.- POS[157][157][157][157][157][157][157]4.- PRINT" 330 PRINTTAB(12)"5.- SPC[157][157][157][157][157][157][157]6.- TAB" 340 PRINT:PRINT 341 PRINTS$ 342 PRINTB$ 345 PRINTF$ 346 GET A$:IF A$=""THEN 346 349 IF A$="[133]"THEN400 350 IF A$="[136]"THEN 200 355 A=VAL(A$) 356 ON A GOTO3010,3020,3030,3040,3050,3060 357 IF A<1ORA>6 THEN 346 400 PRINTCHR$(147) 410 PRINTTAB(10)"ARITHMETIC FUNCTIONS" 420 PRINTTAB(3)"1.- ABS 5.- EXP 9.- SGN" 425 PRINTTAB(3)"[136]2.- ATN 6.- INT A.- SIN" 430 PRINTTAB(3)"3.- COS 7.- LOG B.- SQR" 435 PRINTTAB(3)"4.- DEF FN 8.- RND C.- TAN" 440 PRINTTAB(7)" D.- TI (TIME) E.- VAL" 441 PRINTTAB(6)"SELECT NUMBER OR LETTER FOR EXPLANATION" 442 PRINTF$ 443 PRINTB$ 446 GETA$:IFA$=""THEN446 449 IFA$="[133]"THEN500 450 IF A$="[136]"THEN300 451 A=VAL(A$) 455 ON A GOTO 4010,4020,4030,4040,4050,4060,4070,4080,4090 456 IF A$="A"THEN4100 457 IF A$="B"THEN4110 458 IF A$="C"THEN4120 459 IF A$="D"THEN4130 460 IF A$="E"THEN4140 500 PRINTCHR$(147) 510 PRINTTAB(8)"FILE AND DEVICE HANDLING":PRINTTAB(15)"1.- CLOSE" 520 PRINTTAB(15)"2.- CMD":PRINTTAB(15)"3.- GET#":PRINTTAB(15)"4.- INPUT#" 530 PRINTTAB(15)"5.- OPEN":PRINTTAB(15)"6.- PRINT#" 540 PRINTTAB(15)"7.- STATUS" 541 PRINTS$ 542 PRINTB$ 543 PRINTF$ 546 GET A$:IFA$=""THEN546 549 IF A$="[133]"THEN600 550 IF A$="[136]"THEN400 551 A=VAL(A$) 552 ON A GOTO 5010,5020,5030,5040,5050,5060,5070 560 IF A<1OR A>7THEN546 600 PRINTCHR$(147) 610 PRINTTAB(10)"ARRAY AND VARIABLE":PRINTTAB(13)"MANIPULATION":PRINTTAB(14)"1.- CLR" 620 PRINTTAB(14)"2.- DATA":PRINTTAB(14)"3.- DIM":PRINTTAB(14)"4.- FRE" 630 PRINTTAB(14)"5.- LET":PRINTTAB(14)"6.- READ":PRINTTAB(14)"7.- RESTORE" 641 PRINTS$ 642 PRINTB$ 643 PRINTF$ 646 GET A$:IF A$=""THEN646 649 IFA$="[133]"THEN700 650 IFA$="[136]"THEN500 651 A =VAL(A$) 652 ONA GOTO 6010,6020,6030,6040,6050,6060,6070 660 IF A<1ORA>7THEN646 700 PRINTCHR$(147) 710 PRINTTAB(12)"STRING FUNCTIONS" 720 PRINTTAB(14)"1.- ASC":PRINTTAB(14)"2.- CHR$":PRINTTAB(14)"3.- LEFT$" 730 PRINTTAB(14)"4.- LEN":PRINTTAB(14)"5.- MID$":PRINTTAB(14)"6.- RIGHT$" 740 PRINTTAB(14)"7.- STR$":PRINTTAB(14)"8.- TIME$" 741 PRINTS$ 742 PRINTB$ 743 PRINTF$ 746 GET A$:IFA$=""THEN746 749 IF A$="[133]"THEN800 750 IF A$="[136]"THEN600 751 A=VAL(A$) 752 ON A GOTO 7010,7020,7030,7040,7050,7060,7070,7080 760 IF A<1ORA>8THEN746 800 PRINTCHR$(147) 810 PRINTTAB(12)"MACHINE LANGUAGE":PRINTTAB(15)"INTERFACE" 820 PRINTTAB(14)"1.- PEEK":PRINTTAB(14)"2.- POKE" 830 PRINTTAB(14)"3.- SYS":PRINTTAB(14)"4.- USR" 841 PRINTS$ 842 PRINTF$ 843 PRINTB$ 846 GETA$:IFA$=""THEN846 849 IF A$="[133]"THEN900 850 IF A$="[136]"THEN700 851 A=VAL(A$) 852 ON A GOTO 8010,8020,8030,8040 860 IF A<1 OR A>4THEN846 900 PRINTCHR$(147) 910 PRINTTAB(8)"MISCELLANEOUS STATEMENTS" 920 PRINTTAB(14)"1.- REM":PRINTTAB(14)"2.- WAIT" 943 PRINT""B$ 944 PRINT"PRESS Q TO QUIT" 946 GETA$:IFA$=""THEN946 949 IF A$="[136]"THEN800 950 IF A$="Q"ORA$="[133]" THEN 10000 951 A=VAL(A$) 952 ON A GOTO 9010,9020 1010 PRINTCHR$(147):PRINTTAB(18)"CONT" 1011 PRINTTAB(5)"IF A PROGRAM WAS HALTED BY A 'STOP' OR 'END' STATEMENT-" 1012 PRINTTAB(5)"OR THE RUN/STOP KEY WAS PRESSED-" 1013 PRINTTAB(5)"THE PROGRAM WILL RE-START AT THE" 1014 PRINTTAB(5)"EXACT PLACE WHERE IT LEFT OFF." 1015 PRINTTAB(5)"STOP STATEMENTS ARE USED AS A DEBUGGING TOOL" 1017 PRINTTAB(8)K$ 1018 GETA$:IFA$=""THEN1018 1019 GOTO95 1020 PRINTCHR$(147):PRINTTAB(18)"LIST" 1021 PRINTTAB(5)"'LIST' WILL LIST ALL LINES IN A PROGRAM." 1022 PRINTTAB(5)"'LIST 100-200' WILL LIST ALL LINES FROM 100 TO 200." 1023 PRINTTAB(5)"'LIST 100' WILL LIST ONLY LINE 100." 1024 PRINTTAB(5)"'LIST 100-' WILL LIST ALL LINES" 1025 PRINTTAB(6)"FROM 100 TO END OF PROGRAM." 1026 PRINTTAB(5)"'LIST -100' WILL LIST ALL LINES FROM 0 TO 100." 1027 PRINTTAB(8)K$ 1028 GETA$:IF A$=""THEN1028 1029 GOTO95 1030 PRINTCHR$(147):PRINTTAB(18)"LOAD" 1031 PRINTTAB(5)"FINDS & READS PROGRAM FROM TAPE OR DISK" 1032 PRINTTAB(5)"LOAD (THEN RETURN)- LOADS NEXT PROGRAM ON TAPE" 1033 PRINTTAB(5)"LOAD ";CHR$(34);"PROGRAM";CHR$(34);"-LOADS PROG. FROM TAPE" 1034 PRINTTAB(5)"LOAD";CHR$(34)"*";CHR$(34);"-LOADS FIRST PROGRAM ON DISK" 1035 PRINTTAB(5)"LOAD";CHR$(34)"PROGRAM";CHR$(34);" -LOADS ";CHR$(34);"PROGRAM";CHR$(34); 1036 PRINT"FROM DISK" 1037 PRINTTAB(8)K$ 1038 GET A$:IFA$=""THEN1038 1039 GOTO95 1040 PRINTCHR$(147):PRINTTAB(18)"NEW" 1041 PRINTTAB(5)"THE NEW COMMAND WILL DELETE THE PROG. IN MEMORY" 1042 PRINTTAB(5)"NEW - WILL CLEAR ALL VARIABLES." 1043 PRINTTAB(5)"NEW - SHOULD BE USED BEFORE TYPING IN ANY NEW PROGRAM." 1044 PRINTTAB(5)"NEW CAN BE USED IN A PROGRAM BUT WILL ERASE ALL BEFORE." 1047 PRINTTAB(8)K$ 1048 GET A$:IFA$=""THEN1048 1049 GOTO95 1050 PRINTCHR$(147):PRINTTAB(18)"RUN" 1051 PRINTTAB(5)"RUN WILL START THE PROGRAM IN MEM- ORY:CLEARS VARIABLES" 1052 PRINTTAB(5)"RUN 100 PERFORMS CLR AND STARTS AT LINE 100." 1053 PRINTTAB(5)"RUN MAY ALSO BE USED IN PROGRAM MODE. STARTS AT FIRST"; 1054 PRINT" LINE WITH ALL VARIABLES CLEARED." 1057 PRINTTAB(8)K$ 1058 GETA$:IF A$=""THEN1058 1059 GOTO95 1060 PRINTCHR$(147):PRINTTAB(17)"SAVE" 1061 PRINTTAB(5)"THE SAVE STATEMENT WRITES A COPY OF THE CURRENT"; 1062 PRINT" PROGRAM FROM MEMORY TO EXTERNAL DEVICE (CASSETTE OR DISK)" 1063 PRINTTAB(5)"SAVE (& RETURN) WRITES TO TAPE WITHOUT NAME" 1064 PRINTTAB(5)"SAVE ";CHR$(34);"DOG";CHR$(34);",1 SAVES 'DOG' ON TAPE" 1065 PRINTTAB(5)"SAVE ";CHR$(34);"DOG";CHR$(34);",8 SAVES PROGRAM"; 1066 PRINT" 'DOG' ON DISK." 1067 PRINTK$ 1068 GET A$:IF A$=""THEN1068 1069 GOTO95 1070 PRINTCHR$(147):PRINTTAB(16)"VERIFY" 1071 PRINTTAB(5)"COMPARES PROGRAM IN MEMORY WITH PROG. ON DISK OR TAPE." 1072 PRINTTAB(5)"VERIFY VERIFIES NEXT PROGRAM FOUND ON TAPE." 1073 PRINTTAB(5)"VERIFY ";CHR$(34);"DOG";CHR$(34);" VERIFIES PROG. 'DOG'"; 1074 PRINT" ON TAPE." 1075 PRINTTAB(5)"VERIFY";CHR$(34);"CAT";CHR$(34);",8 VERIFIES PROG. 'CAT'" 1076 PRINTTAB(5)"ON DISK." 1077 PRINTTAB(8)K$ 1078 GET A$:IFA$=""THEN1078 1079 GOTO95 2010 PRINTCHR$(147):PRINTTAB(18)"END" 2011 PRINTTAB(3)"ENDS EXECUTION OF CURRENT PROGRAM." 2012 PRINTTAB(3)"END & STOP STATEMENTS HALT PROGRAM EXECUTION. YOU CAN"; 2013 PRINTTAB(3)" CONTINUE BY TYPING "; 2014 PRINTTAB(3)"CONT. YOU DO NOT HAVE TO USE END OR STOP STATEMENTS, BUT"; 2015 PRINT" THESE STATEMENTS MAKE PROGRAMS EASIER TO USE." 2016 PRINTTAB(3)"END FINISHES A PROGRAM EXECUTION AND DISPLAYS THE READY"; 2017 PRINT" MESSAGE AND GIVES CONTROL BACK TO THE OPERATOR.":PRINTTAB(8)K$ 2018 GET A$:IFA$=""THEN2018 2019 GOTO200 2020 PRINT"[147]":PRINTTAB(15)"FOR.NEXT[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]WILL REPEAT THE"; 2021 PRINT" STATEMENTS BETWEEN THE FOR AND NEXT AS LONG AS VARIABLE" 2022 PRINTTAB(3)"IS LESS THAN OR EQUAL TO END COSTANT. THIS STATEMENT LETS"; 2023 PRINT" YOU USE A VARI- ABLE AS A COUNTER. YOU MUST SPECIFY THE "; 2024 PRINT"NAME OF THE VARIABLE, THE START- ING VALUE, THE END VALUE AND STEP." 2025 PRINTTAB(3)"IF STEP IS OMITTED A STEP OF 1 IS ASSUMED.EXAMPLE" 2026 PRINTTAB(10)"10 FOR A=1 TO 10[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]20 NEXT A" 2027 PRINTTAB(8)K$ 2028 GET A$:IFA$=""THEN2028 2029 GOTO200 2030 PRINT"[147]":PRINTTAB(12)"GOSUB...RETURN" 2031 PRINTTAB(3)"TRANSFERS EXECUTION TO THE LINE INDI- CATED AFTER GOSUB."; 2032 PRINT" UPON REACHING A RETURN STATMENT IT TRANSFERS BACK TO NEXT"; 2033 PRINT" LINE AFTER THE GOSUB STATEMENT." 2034 PRINTTAB(3)"THE INDICATED LINE IS USUALY A SUB- ROUTINE ENTRY POINT." 2035 PRINTTAB(3)"GOSUB IS SIMILAR TO GOTO, EXCEPT THAT WHEN RETURN STATEMENT"; 2036 PRINT" IS REACHED, PROGRAM GOES BACK TO LINE AFTER GOSUB" 2037 PRINTTAB(8)K$ 2038 GETA$:IFA$=""THEN2038 2039 GOTO200 2040 PRINT"[147]":PRINTTAB(15)"IF...THEN[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]ALLOWS BASIC"; 2041 PRINT" PROGRAM TO EXECUTE LINES OUT OF NUMERICAL ORDER." 2042 PRINTTAB(3)"IF AN EXPRESSION IS TRUE,THEN EXECUTE STATEMENT(S)"; 2043 PRINT" (OR GOTO LINE);OTHERWISE EXECUTE NEXT LINE." 2044 PRINTTAB(3)"IF SPECIFIED CONDITION IS TRUE, THEN THE STATEMENT(S)"; 2045 PRINT" FOLLOWING 'THEN' ARE EXECUTED. IF CONDITION IS FALSE, CON-"; 2046 PRINTTAB(3)" TROL PASSES TO THE NEXT LINE AND STATEMENT(S)"; 2047 PRINT"FOLLOWING 'THEN' ARE NOT EXECUTED.":PRINTTAB(13)"10 IF A=1 THEN 50" 2048 PRINTTAB(8)K$ 2049 GETA$:IFA$=""THEN2049 2050 GOTO200 2051 PRINT"[147]":PRINTTAB(18)"GOTO[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]CAN BE USED TO STOP A PROGRAM"; 2052 PRINT" SUCH AS":PRINTTAB(15)"50 GOTO 50":PRINTTAB(3)"GOTO WILL"; 2053 PRINT" UNCONDITIONALLY TRANSFER EXECUTION TO LINE INDICATED." 2054 PRINTTAB(3)"IT ALLOWS A PROGRAM TO EXECUTE LINES OUT OF NUMERICAL ORDER." 2055 PRINTTAB(10)"EXAMPLE: 100 GOTO 300 2057 [153][163]8)K$ 2058 [161] A$:[139]A$[178]""[167]2058 2059 [137]200 2060 [153]"LOAD":[153][163]16)"ON..GOTO":[153][163]3)"CAUSES AN UNCONDITIONAL BRANCH"; 2061 [153]" TO ONE OF SEVERAL POINTS IN PROGRAM, DEPEND- ING ON THE VALUE"; 2062 [153]" OF A VARIABLE.":[153][163]3)"FOR EXAMPLE- IF VALUE IS 2, ON..GOTO"; 2063 [153]" WILL GOTO 2 ND LINE IN THE LIST." 2064 [153][163]3)"IF VALUE IF VARIABLE IS 0 OR > NUMBER OF ITEMS IN LIST"; 2065 [153]", THE PROGRAM IG- NORES THE STATEMENT AND GOES TO NEXT" 2066 [153][163]3)"LINE." 2067 [153][163]8)K$ 2068 [161] A$:[139]A$[178]""[167]2068 2069 [137] 200 2070 [153]"LOAD"::[153][163]16)"ON..GOSUB":[153][163]3)"THE ON..GOSUB STATEMENT "; 2071 [153]"HAS THE SAME FORMAT AS ON..GOTO. DEPENDING ON THE VALUE OF "; 2072 [153]"A VARIABLE THE PROGRAM BRANCHES TO SUBROUTINE.":[153][163]8)"10 "; 2073 [153]"ON A GOSUB 100,200,300":[153][163]3)"IF A = 1 PROGRAM BRANCHES TO 100,"; 2074 [153]"IF A = 2 BRANCH TO 200 ETC." 2075 [153][163]3)"ON..GOSUB USUALLY IS EXECUTED IN PROGRAM MODE, "; 2076 [153]"HOWEVER, IT CAN BE USED IN IMMEDIATE MODE IF THERE ARE LINE #'S"; 2077 [153]" TO BRANCH TO IN PROGRAM.":[153]:[153][163]8)K$ 2078 [161]A$:[139] A$[178]""[167]2078 2079 [137]200 2080 [153]"LOAD":[153][163]18)"STOP":[153][163]3)"THIS STATEMENT CAUSES PROGRAM TO " 2081 [153][163]3)"STOP EXECUTION AND RETURN CONTROL TO BASIC." 2083 [153][163]3)"STOP IS A GOOD TOOL FOR DE-BUGGING A PROGRAM. IT CAN "; 2084 [153]"BE USED TO RUN A PORTION OF A PROGRAM TO TEST TO STOP." 2087 [153][163]8)K$ 2088 [161] A$:[139]A$[178]""[167]2088 2089 [137]200 3010 [153]"LOAD":[153][163]19)"GETCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTHIS STATEMENT RECEIVES"; 3011 [153]" SINGLE CHAR- ACTERS AS INPUT FROM THE KEYBOARD.":[153][163]2)"CAN"; 3012 [153]" BE EXECUTED FROM PROGRAM MODE ONLY":[153][163]2)"WHEN GET IS EXECUTED"; 3013 [153]" VARIABLE IS ASS- IGNED '0'- 0R NULL IF A STRING. PREV. VALUE IS"; 3014 [153]" LOST. THEN 'GET' LOOKS AT NEXT CHARACTER FROM KEYBOARD BUFFER "; 3015 [153]" AND ASSIGNS IT TO THE VARIABLE. IF BUFFER IS EMPTY VARIABLE"; 3016 [153]" REMAINS '0' OR NULL VALUE." 3017 [153][163]8)K$ 3018 [161]A$:[139]A$[178]""[167]3018 3019 [137]300 3020 [153]"LOAD":[153][163]17)"INPUTCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTHIS STATEMENT ALLOWS "; 3021 [153]"OPERATOR TO FEED INFORMATION TO THE COMPUTER.":[153][163]3)"USING "; 3022 [153]"QUOTE MARKS AFTER INPUT ALLOWS TEXT TO BE PRINTED BEFORE ? MARK." 3023 [153][163]3)"PROG. HALTS AND WAITS FOR ANSWER TO BE TYPED IN AND-RETURN-"; 3024 [153]" PRESSED.":[153][163]3)"TYPE IN AS MANY INPUTS AS NEEDED SEP- ARATED BY"; 3025 [153]" COMMAS.":[153][163]3)"IF TOO MUCH DATA IS PUT IN, '?EXTRA IGNORED' "; 3026 [153]"WILL BE DISPLAYED. IF NOT ENOUGH IS PUT IN '??' APPEARS." 3027 [153][163]8)K$ 3028 [161]A$:[139]A$[178]""[167]3028 3029 [137]300 3030 [153]"LOAD":[153][163]19)"POSCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTO USE THE TAB FUNCTION ON "; 3031 [153]"THE PRINTER YOU WILL NEED THE POS INST- RUCTION WHICH IS "; 3032 [153]"REPRESENTED BY CHR$(16).":[153][163]3)"TO PRINT AN * AT TAB(10) "; 3033 [153]" USE":[153]"PRINT#1;CHR$(16);CHR$(49);CHR$(48);"[170][199](34);"*";[199](34) 3034 [153][163]3)"CHR$(49)=1 AND CHR$(48)=0" 3037 [153][163]8)K$ 3038 [161] A$:[139]A$[178]""[167] 3038 3039 [137] 300 3040 [153]"LOAD":[153][163]17)"PRINTCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTHE PRINT STATEMENT "; 3041 [153]"CAUSES DATA TO BE DISPLAYED. THE FIRST DATA ITEM IS" 3042 [153][163]3)"DISPLAYED AT THE CURRENT CURSOR POSI- TION.":[153][163]3)"IF THE "; 3043 [153]"ITEM IS FOLLOWED BY A COMMA, THE NEXT ITEM IS PRINTED AT 1ST TAB " 3044 [153][163]3)"POS 11 & THE NEXT AT POS 21 ETC. A SEMICOLON CAUSES ITEM TO BE 3045 PRINT" PRINTED IN FIRST AVAILABLE COLUMN.":PRINTTAB(3)"NO COMMA OR "; 3046 PRINT"SEMICOLON CAUSES A CAR- RIAGE RETURN TO FOLLOW LAST ITEM." 3047 PRINTTAB(8)K$ 3048 GETA$:IF A$=""THEN 3048 3049 GOTO 300 3050 PRINT"[147]":PRINTTAB(19)"SPC[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]AIDS IN FORMATTING "; 3051 PRINT"TO ALLOW PRINT STATEMENTS TO PRINT MESSAGES IN DIFF- ERENT POS"; 3052 PRINT"ITIONS ON A LINE.":PRINTTAB(3)"SPC IS A SPACE OVER FUNCTION. AFTER SPC"; 3053 PRINT", IN PARENTHESES, INCLUDE THE NUM- BER OF POSITIONS YOU WISH TO "; 3054 PRINTTAB(3)"SPACE OVER.":PRINTTAB(12)"20 ? SPC(10)";CHR$(34)"TITLE";CHR$(34) 3055 PRINTTAB(3)"THE ABOVE WILL PRINT THE WORD TITLE BEGINNING AT SPACE 10. 3057 [153][163]8)K$ 3058 [161] A$:[139] A$[178]""[167]3058 3059 [137] 300 3060 [153]"LOAD":[153][163]19)"TABCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTHIS FUNCTION CAN BE COM"; 3061 [153]"PARED WITH TAB ON A TYPEWRITER." 3062 [153][163]3)"BEGINNING WITH COLUMN 0 YOU CAN CALC- ULATE THE COLUMN YOU "; 3063 [153]"WISH TO HAVE PRINT STATEMENT BEGIN IT'S DISPLAY." 3064 [153][163]7)"30 PRINT TAB(10)";[199](34)[170]"NAME"[170][199](34) 3065 [153][163]3)"MOVES TO COLUMN 10 BEFORE PRINTING 'NAME'." 3067 [153][163]8)K$ 3068 [161] A$:[139] A$[178]""[167] 3068 3069 [137] 300 4010 [153]"LOAD":[153][163]18)"ABSCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDABS(X)=X IF X IS POSITIVE OR 0." 4011 [153][163]3)"ABS(X)=-X IF X IS NEGATIVE." 4012 [153][163]3)"THE ABSOLUTE VALUE OF A NUMBER IS RETURNED WHICH "; 4013 [153]"IS IT'S VALUE WITHOUT A SIGN." 4014 [153][163]3)"THE ABSOLUTE VALUE OF A NEGATIVE NUM- BER IS THAT NUMBER "; 4015 [153] "MULTIPLIED BY -1." 4016 [153][163]14)"20 X=ABS(B)CMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD20 PRINT ABS(B*J)" 4017 [153][163]8)K$ 4018 [161] A$:[139] A$[178]""[167] 4018 4019 [137] 400 4020 [153]"LOAD":[153][163]18)"ATN":[153][163]3)"ATN(X) RETURNS THE ARCTANGENT OF X." 4021 [153][163]3)"THE ARCTANGENT OF X IS THE ANGLE WHOSE TANGENT EQUALS X."; 4022 [153]" THE ANGLE IS RETURNED IN RADIANS.":[153][163]3)"TO COMPUTE "; 4023 [153]"THE ARCTANGENTS EXPRESSED IN DEGRESS, USE THIS FUNCTION." 4024 [153][163]10)"180*ATN(X)*(null)" 4027 [153][163]8)K$ 4028 [161] A$:[139]A$[178]""[167]4028 4029 [137] 400 4030 [153]"LOAD":[153][163]18)"COS" 4031 [153][163]3)"COS(X) CALCULATES THE COSINE OF X WHERE THE NUMBER X "; 4032 [153]"IS THE ANGLE IN RADIANS." 4033 [153][163]8)"10 PRINT COS(X*(null)/180)" 4034 [153][163]5)"(WHERE X IS STATED IN DEGREES)" 4037 [153][163]8)""K$ 4038 [161] A$:[139]A$[178]""[167]4038 4039 [137] 400 4040 [153]"LOAD":[153][163]17)"DEF FN" 4041 [153][163]3)"SETS UP A USER DEFINED FUNCTION THAT CAN BE USED "; 4042 [153]"LATER IN THE PROGRAM.":[153][163]3)"THE FUNCTION CAN BE A "; 4043 [153]"MATHEMATICAL FORMULA THAT IS USED SEVERAL TIMES IN A "; 4044 [153]"PROGRAM. ":[153][163]3)"THE FORMULA IS STATED ONCE AND THEN USED "; 4045 [153]"AS A FUNCTION NAME.":[153][163]12)"10 DEF FN A(X)=X+7" 4046 [153][163]12)"20 PRINT FN(4)":[153][163]8)"(RESULTS IN 11 WHEN RUN)" 4047 [153][163]8)""K$ 4048 [161]A$:[139] A$[178]""[167]4048 4049 [137] 400 4050 [153]"LOAD":[153][163]18)"EXP" 4051 [153][163]3)"EXP(X) CALCULATES THE VALUE OF THE CONSTANT "; 4052 [153] "E=2.718289 TO THE X POWER" 4053 [153][163]12)"10 PRINT EXP(1) 4054 PRINTTAB(10)"(RETURNS 2.718289) 4055 [153][163]3)"A VALUE GREATER THAN 88.0296919 CAUSES AN OVERFLOW"; 4057 [153][163]8)K$ 4058 [161] A$:[139]A$[178]""[167]4058 4059 [137] 400 4060 [153]"LOAD":[153][163]18)"INT":[153][163]3)"RETURNS THE INTEGER PORTION OF A NUM-" 4061 [153][163]3)"ONBER. IT WILL ROUND TO THE NEXT LOWER NUMBER." 4062 [153][163]3)"FOR POSITIVE NUMBERS, INT DROPS THE FRACTIONAL PORTION "; 4063 [153]"OF THE NUMBER WITHOUT ROUNDING.":[153][163]3)"FOR NEGATIVE "; 4064 [153]"NUMBERS, INT DROPS THE FRACTIONAL PORTION OF THE NUMBER AND "; 4065 [153]" ADDS 1." 4067 [153][163]8)K$ 4068 [161]A$:[139]A$[178]""[167] 4068 4069 [137] 400 4070 [153]"LOAD":[153][163]18)"LOG" 4071 [153][163]3)"LOG(X) RETURNS THE NATURAL LOG TO THE BASE E. THE VALUE "; 4072 [153]"OF E=2.71828183" 4073 [153][163]3)"IF X=0 THEN AN ILLEGAL QUATITY ERROR MESSAGE IS DISPLAYED." 4077 [153][163]8)K$ 4078 [161] A$:[139] A$[178]""[167]4078 4079 [137] 400 4080 [153]"LOAD":[153][163]18)"RND":[153][163]3)"RND(X) GENERATES AND RETURNS "; 4081 [153]"RANDOM NUMBER 0.000000000 TO .999999999 (EQUAL TO OR > 0"; 4082 [153]" AND <1.)":[153][163]3)"INT(RND(1)*(N)+1) GENERATES WHOLE" 4083 [153][163]3)"NUMBERS BETWEEN 1 AND N. "; 4084 [153]"N IS UPPER LIMIT OF THE DESIRED NUMBERS." 4087 [153][163]8)K$ 4088 [161]A$:[139] A$[178]""[167]4088 4089 [137]400 4090 [153]"LOAD":[153][163]18)"SGN":[153][163]3)"DETERMINES WHETHER A NUMBER "; 4091 [153]"IS POSI- TIVE, NEGATIVE, OR ZERO." 4092 [153][163]3)"SGN(X) FUNCTION RETURNS (null)1 IF A NUM- BER IS POSITIVE "; 4093 [153]"OR NOT ZERO, 0 IF THE NUMBER IS 0, OR -1 IF THE NUMBER IS " 4094 [153][163]3)"NEGATIVE." 4097 [153][163]8)K$ 4098 [161] A$:[139]A$[178]""[167]4098 4099 [137] 400 4100 [153]"LOAD":[153][163]18)"SIN":[153][163]3)"SIN(X) RETURNS THE SINE OF THE "; 4101 [153]"ANGLE X WHICH IS EXPRESSED IN RADIANS." 4102 [153][163]12)"PRINT SIN(90*(null)/180)" 4103 [153][163]6)"(DISPLAYS SINE OF 90 DEGREES.) 4107 PRINTTAB(8)K$ 4108 GETA$:IFA$=""THEN4108 4109 GOTO 400 4110 PRINT"[147]":PRINTTAB(18)"SQR":PRINTTAB(3)"SQR(X) RETURNS THE SQUARE "; 4111 PRINT"ROOT OF X WHERE X IS A POSITIVE NUMBER." 4112 PRINTTAB(3)"IF X=NEGATIVE NUMBER AN ERROR MESSAGE IS RETURNED." 4113 PRINTTAB(14)"10 B=SQR(9)":PRINTTAB(14)"20 PRINT B" 4114 PRINTTAB(7)"(RESULTS IN DISPLAY OF 3) 4117 [153][163]8)K$ 4118 [161]A$:[139]A$[178]""[167]4118 4119 [137]400 4120 [153]"LOAD":[153][163]18)"TAN" 4121 [153][163]3)"TAN(X) RETURNS THE TANGENT OF THE ANGLE X WHICH "; 4122 [153]"IS EXPRESSED IN RADIANS." 4123 [153][163]12)"10 C=TAN(45*(null)/180)" 4124 [153][163]12)"20 PRINT C" 4125 [153][163]4)"(RETURNS TANGENT OF 45 DEGREE ANGLE)" 4127 [153][163]8)K$ 4128 [161] A$:[139] A$[178]""[167]4128 4129 [137] 400 4130 [153]"LOAD":[153][163]14)"TI -(TIME)" 4131 [153][163]3)"RETURNS NUMBER OF JIFFIES SINCE THE CURRENT START UP"; 4132 [153]" OR RESET.":[153][163]3)"TI$ IS THE TIME OF DAY STRING." 4133 [153][163]13)"TI$="[199](34)[170]"000000"[170][199](34) 4137 [153][163]8)K$ 4138 [161]A$:[139]A$[178]""[167]4138 4139 [137] 400 4140 [153]"LOAD":[153][163]18)"VAL":[153][163]3)"VAL(X$) RETURNS THE NUMERICAL "; 4141 [153]"EQUIV- ALENT OF THE STRING X$." 4142 [153][163]3)"THE NUMBER MAY BE USED IN ARITHMETIC CALCULATIONS." 4143 [153][163]3)"VAL FIRST DISCARDS ANY LEADING BLANKS. IF THE "; 4144 [153]"FIRST NON BLANK CHAR- ACTER IS NOT A DIGIT, VAL RETURNS A 0." 4145 [153][163]3)"IF FIRST NON BLANK IS A DIGIT, VAL CONVERTS "; 4146 [153]"THE STRING INTO REAL NUM- BERS." 4147 [153][163]8)K$ 4148 [161]A$:[139]A$[178]""[167]4148 4149 [137] 400 5010 [153]"LOAD":[153][163]16)"CLOSE":[153][163]3)"AFTER FILE ACCESS HAS BEEN "; 5011 [153]"COMPLETED, CLOSE STATEMENT SHUTS OFF THE DATA FILE." 5012 [153][163]3)"AN OPEN CHANNEL TO DEVICE (D-DR/PRTR) SHOULD BE CLOSED "; 5013 [153]"WHEN ACCESS IS COMP- LETED.":[153][163]3)"THE FILE NUMBER CLOSED "; 5014 [153]"SHOULD BE THE SAME AS NUMBER OPENED.":[153][163]12)"10 PRINT#4:"; 5015 [153]"CLOSE4":[153][163]4)"(THIS CLOSES CHANNEL TO PRINTER)" 5017 [153][163]8)K$ 5018 [161]A$:[139]A$[178]""[167]5018 5019 [137]500 5020 [153]"LOAD":[153][163]18)"CMD":[153][163]3)"THIS STATEMENT CONVERTS PRIMARY DEV-" 5021 [153][163]3)"ICE FROM MONITOR TO DEVICE SPECIFIED." 5022 [153][163]3)"THE FILE NUMBER MUST BE SPECIFIED IN AN OPEN STATEMENT." 5023 [153][163]3)"WHEN CMD IS IN EFFECT, PRINT STATE- MENTS AND LIST COMMAND "; 5024 [153]"WILL NOT DIS- PLAY ON THE SCREEN.":[153][163]3)"CMD CAN BE "; 5025 [153]"USED IN DIRECT PROGRAM MODE.":[153][163]11)"OPEN4,4:CMD4:LIST" 5026 [153][163]3)"(PRINTS PROGRAM LISTING ON PRINTER)" 5027 [153][163]8)"ON"K$ 5028 [161]A$:[139] A$[178]""[167]5028 5029 [137] 500 5030 [153]"LOAD":[153][163]18)"GET#":[153][163]3)"THIS STATEMENT 'GETS' A SINGLE"; 5031 [153]" CHAR- ACTER FROM AN EXTERNAL STORAGE DEV- ICE. THIS CHARACTER "; 5032 [153]"IS ASSIGNED TO VARIABLE.":[153][163]3)"THE FILE NUMBER USED TO"; 5033 [153]" IDENTIFY THE EXTERNAL DEVICE MUST HAVE B"; 5034 [153]"EEN PROP- ERLY OPENED WITH AN OPEN STATEMENT." 5035 [153][163]10)"20 OPEN 1,3:GET#1,A$" 5036 [153][163]3)"GET# MUST BE USED IN PROGRAM MODE ONLY." 5037 [153][163]8)K$ 5038 [161]A$:[139]A$[178]""[167]5038 5039 [137]500 5040 [153]"LOAD":[153][163]16)"INPUT#":[153][163]3)"THIS STATEMENT INPUTS DATA FROM AN" 5041 [153][163]3)"EXTERNAL DEVICE AND ASSIGNS DATA TO VARIABLES." 5042 [153][163]3)"INPUT AND INPUT# WORK IDENTICALLY EXCEPT INPUT# RECEIVES "; 5043 [153]"ITS INPUT FROM A FILE." 5044 [153][163]3)"INPUT# MUST BE USED IN PROGRAM MODE ONLY." 5047 [153][163]8)K$ 5048 [161]A$:[139] A$[178]""[167]5048 5049 [137]500 5050 [153]"LOAD":[153][163]18)"OPEN":[153][163]3)"THIS STATEMENT OPENS A FILE AND MAKES" 5051 [153][163]3)"ONTHE ASSIGNED DEVICE READY TO GIVE OR RECEIVE "; 5052 [153]"DATA.":[153][163]3)"OPEN WITH NO DEVICE NO. SELECTS TAPE UNIT." 5053 [153][163]2)"OPEN [FILE],[DEV.],[SEC ADD],["[199](34)[170]"NAME"[199](34)[170]"]" 5054 [153][163]3)"SECONDARY ADD= 0 INDICATES READ ONLY":[153][163]16)"= 1 INDICATES"; 5055 [153]" OPENED TO WRITE":[153][163]16)"= 2 INDICATES WRITE WITH" 5056 [153][163]20)"ONEND OF TAPE MARK." 5057 [153][163]8)K$ 5058 [161] A$:[139]A$[178]""[167]5058 5059 [137]500 5060 [153]"LOAD":[153][163]16)"PRINT#":[153][163]3)"THE PRINT EXTERNAL STATEMENT OUTPUTS" 5061 [153][163]3)"ONE OR MORE DATA ITEMS TO AN EXTERNAL" 5062 [153][163]3)"ONDEVICE, SUCH AS THE DISK DRIVE OR PRINTER." 5063 [153][163]3)"THE OUTPUT GOES TO THE DEVICE NUMBER USED IN THE OPEN "; 5064 [153]"STATEMENT." 5067 [153][163]8)K$ 5068 [161]A$:[139]A$[178]""[167]5068 5069 [137]500 5070 [153]"LOAD":[153][163]16)"STATUS":[153][163]3)"THIS VARIABLE INDICATES THE STATUS" 5071 [153][163]3)"OF THE EXTERNAL DEVICES CONNECTED TO YOUR 64." 5072 [153][163]3)"ST VALUE OF 64 INDICATES END OF FILE FOR TAPE AND DISK DRIVE." 5073 [153][163]3)"ST VALUE OF -128 MEANS END OF TAPE ENCOUNTERED OR DISK"; 5074 [153]" DRIVE NOT PRESENT":[153][163]3)"STATUS IS THE SYSTEM DEFINED "; 5075 [153]"VARIABLE INTO WHICH THE KERNAL PUTS STATUS OF I/O OPERATIONS."; 5076 [153]" SEE PROG. REF. GUIDE FOR TABLE OF STATUS CODES." 5077 [153][163]8)K$ 5078 [161]A$:[139]A$[178]""[167]5078 5079 [137]500 6010 [153]"LOAD":[153][163]18)"CLR":[153][163]3)"THIS STATEMENT ERASES FROM "; 6011 [153]"MEMORY ALL VARIABLES, ARRAYS, GOSUB ADDRESSES, FOR...NEXT LOOPS,"; 6012 [153]" USER DEFINED FUNCT- IONS "; 6013 [153]"AND FILES.":[153][163]3)"ANY BASIC PROGRAM IN MEMORY IS NOT "; 6014 [153]" AFFECTED.":[153][163]3)"THIS STATEMENT WILL ALSO UNDIMENSION "; 6015 [153]" ALL ARRAYS. ARRAY SPACE IN MEMORY IS RELEASED." 6017 [153][163]8)K$ 6018 [161]A$:[139]A$[178]""[167]6018 6019 [137]600 6020 [153]"LOAD":[153][163]17)"DATA":[153][163]3)"THIS STATEMENT DECLARES CONSTANTS" 6021 [153]" THAT ARE ASSIGNED TO VARIABLES BY A READ STATEMENT." 6022 [153][163]3)"DATA STATEMENTS MAY BE PLACED ANY- WHERE IN A PROGRAM"; 6023 [153]" AND MAY CONTAIN EITHER NUMERIC OR STRING CONSTANTS." 6024 [153][163]3)"BLANKS, COMMAS, COLONS, & GRAPHIC CHARACTERS ARE "; 6025 [153]"IGNORED UNLESS THE STRING IS ENCLOSED IN QUOTES." 6027 [153][163]8)K$ 6028 [161]A$:[139]A$[178]""[167]6028 6029 [137]600 6030 [153]"LOAD":[153][163]18)"DIM":[153][163]3)"THE DIMENSION STATEMENT ALLOCATES" 6031 [153][163]3)"SPACE IN MEMORY FOR ARRAY VARIABLES. ARRAYS WITH MORE "; 6032 [153]"THAN 11 ELEMENTS MUST BE DIMENSIONED IN A DIM STATE- MENT." 6033 [153][163]6)"10 DIM A(15),A$(30),CD%(5,5)" 6034 [153][163]3)"THE LOWEST ELEMENT IN AN ARRAY IS ZERO. DIM A(5) "; 6035 [153]"DIMENSIONS VARIABLE WITH 6 ELEMENTS.(ZERO IS 1 ELEM.) 6037 PRINTTAB(8)K$ 6038 GETA$:IFA$=""THEN6038 6039 GOTO600 6040 PRINT"[147]":PRINTTAB(18)"FRE":PRINTTAB(3)"THIS FUNCTION TELLS YOU HOW MUCH RAM" 6041 PRINT" IS AVAILABLE FOR A PROGRAM. IF A PROGRAM USES MORE SPACE "; 6042 PRINT"THAN AVAIL- ABLE, 'OUT OF MEMORY' ERROR WILL APPEAR." 6043 PRINTTAB(3)"THIS FUNCTION IS NORMALLY USED IN AN IMMEDIATE MODE "; 6044 PRINT"STATEMENT.":PRINTTAB(9)"? FRE(0)-(FRE(0)<0)*65536" 6045 PRINTTAB(3)"(THE ABOVE TELLS YOU THE CURRENT AVAILABLE RAM)" 6047 PRINTTAB(8)K$ 6048 GETA$:IFA$=""THEN6048 6049 GOTO600 6050 PRINT"[147]":PRINTTAB(18)"LET":PRINTTAB(3)"THIS STATEMENT IS USED TO ASSIGN A" 6051 PRINTTAB(3)"NUMBER TO A VARIABLE.":PRINTTAB(3)"THE WORD LET IS OPTIONAL "; 6052 PRINT"AND IS":PRINTTAB(3)"SELDOM USED AS IT USES MEMORY UNNEC- ESSARILY." 6053 PRINTTAB(12)"10 LET X=16":PRINTTAB(15)"OR":PRINTTAB(12)"10 X=16" 6057 PRINTTAB(8)K$ 6058 GETA$:IFA$=""THEN6058 6059 GOTO600 6060 PRINT"[147]":PRINTTAB(17)"READ":PRINTTAB(3)"THIS STATEMENT CAUSES NAMES FROM "; 6061 PRINT"CON- STANTS IN DATA STATEMENTS TO BE ASS- IGNED TO VARIABLES." 6062 PRINTTAB(3)"WHEN READ IS LOOKING FOR A NUMBER AND A STRING IS READ"; 6063 PRINT" INSTEAD OF A NUMBER, A TYPE MISMATCH ERROR APPEARS." 6064 PRINTTAB(3)"THERE CAN BE MORE DATA ITEMS THAN READ STATEMENTS,"; 6065 PRINT" BUT TOO FEW ITEMS WILL RESULT IN -'?OUT OF DATA ERROR.'" 6067 PRINTTAB(8)K$ 6068 GETA$:IFA$=""THEN6068 6069 GOTO600 6070 PRINT"[147]":PRINTTAB(17)"RESTORE":PRINTTAB(3)"THIS STATEMENT RESETS THE POINTER TO" 6071 PRINTTAB(3)"THE DATA CONSTANT TO BE READ.":PRINTTAB(3)"WHEN USED IN A PROGRAM "; 6072 PRINT"IT ALLOWS THE DATA STATEMENTS TO BE RE-READ." 6073 PRINTTAB(3)"RESTORE IS USED BY ITSELF IN A LINE IN IMMEDIATE OR "; 6074 PRINT"PROGRAM MODE.":PRINTTAB(15)"110 RESTORE" 6077 PRINTTAB(8)K$ 6078 GETA$:IFA$=""THEN6078 6079 GOTO 600 7010 PRINT"[147]":PRINTTAB(16)"ASC":PRINTTAB(3)"THIS NUMERIC FUNCTION WILL RETURN" 7011 PRINTTAB(3)"A NUMBER WHICH CORRESPONDS TO "; 7012 PRINTTAB(3)"COMMOD- ORE ASCII VALUE OF THE FIRST CHAR- ACTER "; 7013 PRINT"IN A STRING.":PRINTTAB(3)"EXAMPLE: 20 PRINT ASC("CHR$(34);"Z"CHR$(34);")" 7014 PRINTTAB(12)"30 ? ASC("CHR$(34);"DOLL"CHR$(34);")":PRINTTAB(12)"40 A=ASC(A$) 7015 [153][163]3)"PRINT ASC("[199](34);"A"[199](34);") CLOSE(RETURNS 65)" 7017 [153][163]8)K$ 7018 [161]A$:[139]A$[178]""[167]7018 7019 [137]700 7020 [153]"LOAD":[153][163]16)"CHR$":[153][163]3)"RETURNS THE STRING REPRESENT"; 7021 [153]"ATION OF ASCII CODE." 7022 [153]" USE CHR$(NNN) (WHERE NNN IS ASCII NO. FROM 0 TO 255)" 7023 [153][163]6)"10 PRINT CHR$(34);"[199](34);"BABY"[199](34);"CHR$(34)" 7024 [153]" (RETURNS "[199](34);"BABY"[199](34);")" 7025 [153]" WHEN IT IS IMPOSSIBLE TO USE A KEY AS 'RETURN' USE:" 7026 [153]" 100 GET A$:IFA$=CHR$(13) GOTO 200" 7027 [153][163]8)K$ 7028 [161] A$:[139]A$[178]""[167]7028 7029 [137]700 7030 [153]"LOAD":[153][163]16)"LEFT$":[153][163]3)"RETURNS LEFTMOST CHARACTER(S)"; 7031 [153]" OF A STRING." 7032 [153]" B$=LEFT$(A$,2) RETURNS THE LEFTMOST 2 CHARACTERS OF STRING A$." 7033 [153]" PRINT LEFT$("[199](34);"RUBBER"[199](34);",3) PRINTS 'RUB'" 7034 [153][163]10)"10 A$=LEFT$("[199](34);"COMMODORE"[199](34);",5)" 7035 [153][163]10)"20 PRINT A$CMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD(RETURNS 'COMMO' WHEN RUN) 7037 PRINTTAB(8)K$ 7038 GETA$:IFA$=""THEN7038 7039 GOTO700 7040 PRINT"[147]":PRINTTAB(16)"LEN":PRINTTAB(3)"RETURNS THE LENGTH OF A STRING." 7041 PRINTTAB(3)"PRINT LEN("CHR$(34);"APPLE"CHR$(34);") DISPLAYS 5" 7042 PRINTTAB(3)"A=LEN("CHR$(34);"CAT"CHR$(34);"+"CHR$(34);"DOG"CHR$(34); 7043 PRINT"):PRINT A":PRINTTAB(9)"(RETURNS 6) 7047 [153][163]8)K$ 7048 [161] A$:[139]A$[178]""[167]7048 7049 [137]700 7050 [153]"LOAD":[153][163]16)"MID$":[153][163]3)"RETURNS A SPECIFIED PORTION OF A" 7051 [153]" STRING.":[153][163]3)"MID$("[199](34);"COMMODORE"[199](34);",3,2)"; 7052 [153]" (RETURNS 'MM') 7053 PRINTTAB(3)"MID$("CHR$(34);"COMMODORE"CHR$(34);",7)"; 7054 PRINT" (RETURNS 'ORE') 7057 [153][163]8)K$ 7058 [161]A$:[139]A$[178]""[167]7058 7059 [137]700 7060 [153]"LOAD":[153][163]16)"RIGHT$":[153][163]3)"RETURNS THE RIGHTMOST CHARACTERS IN" 7061 [153]" A STRING.":[153][163]3)"RIGHT$("[199](34);"BASIC"[199](34);",3)"; 7062 [153]" (RETURNS 'SIC') 7063 PRINTTAB(7)"10 WRD$="CHR$(34);"COMMODORE CLUB"CHR$(34) 7064 PRINTTAB(7)"20 PRINT RIGHT$(WRD$,4)":PRINTTAB(14)" 7065 [153][163]7)"(RETURNS 'CLUB' WHEN RUN) 7067 PRINTTAB(8)K$ 7068 GET A$:IFA$=""THEN7068 7069 GOTO700 7070 PRINT"[147]":PRINTTAB(16)"STR$":PRINTTAB(3)"RETURNS THE STRING REPRESENTATION" 7071 PRINT" OF THE NUMERIC ARGUMENT.":PRINTTAB(3)"EXAMPLE: 10 AB=45.3:"; 7072 PRINT"A$=STR$(AB)":PRINTTAB(13)"20 PRINT AB,A$ 7073 [153][163]13)"(RETURNS 45.3 45.3)" 7074 [153][163]3)"ANY NUMBER CONVERTED TO STRING VALUE THE NUMBER SHOWN "; 7075 [153]"WILL BE PRECEDED AND FOLLOWED BY A SPACE." 7077 [153][163]8)K$ 7078 [161]A$:[139]A$[178]""[167]7078 7079 [137]700 7080 [153]"LOAD":[153][163]16)"TIME$":[153][163]3)"THE TI$ TIMER WORKS LIKE A CLOCK" 7081 [153]" AFTER IT IS SET AND AS LONG AS THE COMPUTER IS TURNED ON." 7082 [153]" THE FORMAT FOR SETTING THE CLOCK IS TI$="[199](34);"HHMMSS"; 7083 [153][199](34);" WHERE HH IS HOUR BETWEEN 0 AND 23, MM IS THE MINUTES"; 7084 [153]" BETWEEN 0 AND 59, SS IS THE SECONDS BETWEEN 0 AND 59." 7085 [153][163]3)"TIME CAN BE SET TO ANY STARTING POINT AS A STOP WATCH." 7087 [153][163]8)K$ 7088 [161]A$:[139]A$[178]""[167]7088 7089 [137]700 8010 [153]"LOAD":[153][163]16)"PEEK":[153][163]3)"THIS STATEMENT ALLOWS YOU TO"[199](34); 8011 [153]" PEEK"[199](34);" INTO ANY OF THE 65536 MEMORY LOCA- TIONS"; 8012 [153]" TO SEE WHAT IS STORED IN ANY OF THESE LOCATIONS." 8013 [153][163]3)"THE NUMBER STORED IN ANY MEMORY LOC- ATION MAY BE "; 8014 [153]"ASSIGNED TO A VARIABLE." 8017 [153][163]8)K$ 8018 [161]A$:[139]A$[178]""[167]8018 8019 [137]800 8020 [153]"LOAD":[153][163]16)"POKE":[153][163]3)"THIS STATEMENT WRITES DATA INTO A" 8021 [153]" MEMORY LOCATION. POKE 53280,A WRITES THE VALUE OF A INTO "; 8022 [153]"MEMORY LOCATION 53280. THE VALUE OF A CAN BE ANY " 8023 [153]" EXPRESSION WHICH CAN BE REDUCED TO AN INTEGER VALUE OF 0 TO 255. "; 8024 [153]"IF A IS A FLOATING POINT VARIABLE, IT IS AUTO- MATICALLY "; 8025 [153]"CONVERTED TO AN INTEGER." 8026 [153][163]3)"YOU CAN POKE ONLY INTO READ/WRITE MEMORY." 8027 [153][163]8)K$ 8028 [161]A$:[139]A$[178]""[167]8028 8029 [137]800 8030 [153]"LOAD":[153][163]16)"SYS":[153][163]3)"TO TRANSFER CONTROL TO MACHINE "; 8031 [153]"LANG- UAGE USE SYS(STARTING ADDRESS) WHERE STARTING ADDRESS "; 8032 [153]"MUST BE 0 TO 65535.":[153][163]3)"SYS CAN BE USED IN DIRECT OR PROGRAM" 8033 [153]" MODE. WHEN SYS IS USED, ML SECTION MUST BE ENDED WITH RTS "; 8034 [153]"INSTRUCTION SO BASIC EXECUTION WILL RESUME WITH STATEMENT"; 8035 [153]" FOLLOWING SYS COMMAND." 8037 [153][163]8)K$ 8038 [161]A$:[139]A$[178]""[167]8038 8039 [137]800 8040 [153]"LOAD":[153][163]16)"USR":[153][163]3)"MEMORY LOC. 785-786 ARE POKED TO SET" 8041 [153]" UP STARTING ADDRESS FOR A MACHINE LANGUAGE SUB ROUTINE." 8042 [153]" THE USR(NUM.ARG.) FUNCTION JUMPS TO ML SUBROUTINE AND THE "; 8043 [153]"VALUE OF THE ARGUMENT IS STORED IN THE FLOATING PT ACCUMULATOR"; 8044 [153]" STARTING AT LOCATION 97 TO BE ACCESSED BY THE ASSEMBLER CODE." 8045 [153]" THE RESULT OF THE USR FUNCTION IS THE VALUE THAT ENDS UP IN "; 8046 [153]"LOCATION 97 WHEN SUBROUTINE RETURNS TO BASIC." 8047 [153][163]8)K$ 8048 [161]A$:[139]A$[178]""[167]8048 8049 [137]800 9010 [153]"LOAD":[153][163]18)"REM":[153][163]3)"REM STATEMENTS HELP TO EXPLAIN PROG-" 9011 [153]" RAMS WHEN LISTED. REM STATEMENTS AND ALL THAT FOLLOW ON THAT "; 9012 [153]"LINE ARE IG- NORED BY COMPUTER." 9013 [153]" A GOTO OR GOSUB CAN SEND PROGRAM TO REM STATEMENT AND "; 9014 [153]"EXECUTION WILL CON- TINUE AT NEXT HIGHER PROGRAM LINE" 9015 [153]" WITH STATEMENT THAT CAN BE EXECUTED." 9017 [153][163]8)K$ 9018 [161]A$:[139]A$[178]""[167]9018 9019 [137]900 9020 [153]"LOAD":[153][163]18)"WAIT":[153][163]3)"THIS STATEMENT IS SELDOM USED. IT" 9021 [153]" STOPS THE PROGRAM UNTIL A CERTAIN MEMORY LOCATION'S BITS "; 9022 [153]"CHANGE IN A SPECIFIC WAY.":[153][163]3)"WAIT IS USED "; 9023 [153]"FOR CERTAIN I/O OPER- ATIONS AND ALMOST NOTHING ELSE." 9024 [153][163]3)"IT IS A TOOL TO BE USED BY EXPER- IENCED PROGRAMMERS ONLY." 9027 [153][163]8)K$ 9028 [161]A$:[139]A$[178]""[167]9028 9029 [137]900 10000 [128]